var bundle={
	upload:function(){
		var process=$('#fileUploadProcess');
		if(!process.is('form')){
			var dia=['fileUploadProcess'];
			dialog.loadDep(dia,{},bundle.upload);
			return;
		}
//		$("#bundleUpload [name='root']").val($("#fileManagerSearchList [name='root']").val());
		$('#bundleUpload').ajaxSubmit({
			url:"bundleAction_upload.action",
		    beforeSend: function() {
		    	process.dialog('open');
		    	process.children(".percent").progressbar({
					value: 0
				});
		    },
		    uploadProgress: function(event, position, total, percentComplete) {
		    	process.children(".percent").progressbar({
					value: percentComplete
				});
		    },
			success:function(xhr){
				process.dialog('close');
				var data;
				if(typeof(xhr)=="object"){
					data=xhr;
				}else{
					data=$.parseJSON(xhr);
				}
				if($.isEmptyObject(data.actionErrors)){
					commons.openDia({'dialog':'bundleAdd',callback:function(){
							var inputs=$('#bundleAdd input');
							$.each(inputs,function(i, n){
								try{
									var current=$(this);
									current.val("");
									var name=$(this).attr("name");
									var val=eval("data."+name);
									current.val(val);
								}catch(e){}
							});
						}
					});
					
					$("#bundleUpload").dialog('close');
				}else{
					alert(data.actionErrors.join('<br/>'));
				}
			}
		}); 
	},
	install:function(param){
		$.post("bundleAction_install.action",param,function(data){
			
		});
	}
}